package cn.livingCloud.dto;

import cn.livingCloud.entity.content.Button;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by sujiantang on 2016/1/7.
 */
public class ButtonFormListDto extends ButtonFormDto {

    private List<ButtonFormDto> buttonList = new ArrayList<>();

    private String addNewButton;

    public ButtonFormListDto() {
        super();
    }

    public List<ButtonFormDto> getButtonList() {
        return buttonList;
    }

    public ButtonFormListDto setButtonList(List<ButtonFormDto> buttonList) {
        this.buttonList = buttonList;
        return this;
    }

    public void loadList(List<Button> buttons) {
        for (Button button : buttons) {
            ButtonFormDto formDto = new ButtonFormDto();
            formDto.load(button);
            buttonList.add(formDto);
        }
    }

    public void loadList(Button button) {
        ButtonFormDto formDto = new ButtonFormDto();
        formDto.load(button);
        buttonList.add(formDto);
    }

    public String getAddNewButton() {
        return addNewButton;
    }

    public ButtonFormListDto setAddNewButton(String addNewButton) {
        this.addNewButton = addNewButton;
        return this;
    }
}
